<template>
    <view v-if="list.length != 0">
        <u-subsection :list="list" :mode="mode" :current="currentNum" :active-color="activeColor" :height="height"
            @change="sectionChange"></u-subsection>
    </view>
</template>

<script>
export default {
    name: "cu-subsection",
    data() {
        return {
        }
    },
    props: {
        // 数据 
        list: {
            type: Array,
            default: () => []
        },
        // 模式
        mode: {
            type: String,
            default: 'subsection',
        },
        // 激活颜色
        activeColor: {
            type: String,
            default: '#0052D9',
        },
        // 高度
        height: {
            type: Number,
            default: 60,
        },
        // 选中值
        currentNum: {
            type: Number,
            default: 0,
        },
    },

    methods: {
        sectionChange(index) {
            this.$emit('sectionChange', index);
        }
    },
}
</script>

<style lang="scss" scoped></style>
